import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 获取系统管理-用户管理列表 */
export const getUserList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/user/page"), {
    params: filerEmptyVal(params)
  });
};

/** 新增 */
export const addUser = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/user/add"), { data });
};

/**  修改 */
export const upUser = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/user/update"), { data });
};

/**  删除 */
export const delUser = (userId?: number) => {
  return http.request<any>("post", baseUrlApi("/user/delete?id=" + userId));
};

/**  重置密码 */
export const resetPwd = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/user/reset/pwd"), { data });
};

/**  禁用/启用 */
export const userEnable = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/user/enable"), { data });
};
